import request from '@/utils/request'

// 可采购终端查询
export function posListApi(data: any) {
    return request({
        url: '/posSales/findBySaleTarget',
        method: 'post',
        data
    })
}
// 查询收款信息
export function getPayBankAccountInfo(data: any) {
    return request({
        url: '/posSales/getPayBankAccountInfo',
        method: 'post',
        data
    })
}
// 查询默认地址
export function findDefault(data: any) {
    return request({
        url: '/posSalesAddress/findDefault',
        method: 'post',
        data
    })
}
//收货人地址列表
export function addresses(data: any) {
    return request({
        url: '/posSalesAddress/findByAgentNo',
        method: 'post',
        data
    })
}
//收货人地址列表
export function editAddress(data: any) {
    return request({
        url: '/posSalesAddress/saveOrUpdate',
        method: 'post',
        data
    })
}
// 删除地址
export function delAddr(params: any) {
    return request({
        url: '/posSalesAddress/delAddr',
        method: 'get',
        params
    })
}
// 修改地址信息  设默认
export function setDetailAddress(params: any) {
    return request({
        url: '/posSalesAddress/updateDefault',
        method: 'get',
        params
    })
}
//  查询账户积分
export function pointsBal(data: any) {
    return request({
        url: '/account/pointsBal',
        method: 'post',
        data
    })
}
// 销售单保存
export function saveBill(data: any) {
    return request({
        url: '/posSales/saveBill',
        method: 'post',
        data
    })
}
// 上传图片
export function commUploadImg(data: any) {
    return request({
        url: '/commUploadImg',
        method: 'post',
        data
    })
}
// 查询订单列表
export function posSalesQuery(data: any) {
    return request({
        url: '/posSales/query',
        method: 'get',
        params: data
    })
}
// 查询订单列表 代发货、待收货、完成
export function posStoreOutQuery(data: any) {
    return request({
        url: '/posStoreOut/query',
        method: 'get',
        params: data
    })
}
// 确认收货
export function confirmReceived(data: any) {
    return request({
        url: '/posStoreOut/confirmReceived',
        method: 'get',
        params: data
    })
}
// 生成订单号
export function toPay(data: any) {
    return request({
        url: '/posSales/toPay',
        method: 'post',
        data: data
    })
}